home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / lib / pvm.os2 < prev    next >
Text File  |  1997-08-03  |  1KB  |  62 lines

  1. #!/bin/sh
  2. #
  3. #    $Id: pvm,v 1.1 1996/09/23 21:15:44 pvmsrc Exp $
  4. #
  5. #    Start the appropriate pvm console.
  6. #    If PVM_ROOT is not set in environment,
  7. #        we try to guess it by combining the working directory with
  8. #        argv[0], otherwise it defaults to $HOME/pvm3.
  9. #    If PVM_ARCH is not set,
  10. #        we get it by execing $PVMROOT/lib/pvmgetarch.
  11. #
  12. #    09 Apr 1993  Manchek
  13. #
  14.  
  15. case "x$PVM_ROOT" in x )
  16.     case "$0" in
  17.     /*) PVM_ROOT="$0" ;;
  18.     *) PVM_ROOT=`pwd`/"$0" ;;
  19.     esac
  20.     PVM_ROOT=`echo "$PVM_ROOT" | sed -e 's/\/lib\/pvm//'`
  21.     if [ -d $PVM_ROOT ]; then
  22.         export PVM_ROOT
  23.     else
  24.         if [ -d $HOME/pvm3 ]; then
  25.             PVM_ROOT=$HOME/pvm3
  26.             export PVM_ROOT
  27.         else
  28.             echo pvm: PVM_ROOT not defined >&2
  29.             exit 1
  30.         fi
  31.     fi
  32. ;; esac
  33.  
  34. #
  35. # these lines let you set environment variables on systems
  36. # where a shell profile doesn't get read when rshing in.
  37. #
  38. if [ -f $PVM_ROOT/.pvmprofile ]; then
  39.     . $PVM_ROOT/.pvmprofile
  40. fi
  41. if [ -f $HOME/.pvmprofile ]; then
  42.     . $HOME/.pvmprofile
  43. fi
  44.  
  45. case "x$PVM_ARCH" in x | xUNKNOWN )
  46.     PVM_ARCH="`$PVM_ROOT/lib/pvmgetarch`"
  47.     case "x$PVM_ARCH" in x )
  48.         echo pvm: can\'t set arch >&2
  49.         exit 1
  50.     ;; esac
  51. ;; esac
  52.  
  53. if [ ! -f $PVM_ROOT/lib/$PVM_ARCH/pvm.exe ]; then
  54.     echo "pvm: $PVM_ROOT/lib/$PVM_ARCH/pvm.exe doesn't exist." >&2
  55.     echo "Make sure PVM is built and PVM_ROOT is set correctly" >&2
  56.     exit 1
  57. fi
  58. export PVM_ARCH
  59. exec $PVM_ROOT/lib/$PVM_ARCH/pvm.exe $@
  60. exit 1
  61.  
  62.